1. Field of the Invention
The present invention relates to a focus detection device for use in a camera, still camera, video, or the like. The focus detection device detects a focus condition of an image in the photo-optical system.
2. Description of Related Art
Focus detection devices for cameras, which include position difference detection apparatus and methods, are known. FIG. 6 shows a known arrangement for a focus detection device that uses the position difference detection method. Light rays, which are incident to region 101 of the object lens 100, pass through, in order, a field mask 200, a field lens 300, an aperture stop 401, and re-imaging lens 501. The light rays form a subject image on a line image sensor array A. Line image sensor array A includes a plurality of photoelectric converting elements, which are linearly arranged to generate outputs according to the incident light's intensity.
Similarly, light rays, which are incident through region 102 of the object lens 100, pass through, in order, the field mask 200, the field lens 300, an aperture stop 402, and a re-imaging lens 502. The light rays form a subject image on a line image sensor array B. Line image sensor array B includes a plurality of photoelectric converting elements, which are linearly arranged to generate outputs according to the incident light's intensity.
The pair of subject images diverge in a front focus condition, when the object lens 100 forms an image of the subject in front of a pre-determined focus surface. The pair of subject images converge in a back focus condition, when object lens 100 forms an image of the subject behind the pre-determined focus surface. In the focused condition, object lens 100 forms an image of the subject on the pre-determined focus surface. Therefore, the subject images of the line image sensor arrays A,B coincide with each other.
The pair of subject images undergoes photoelectric conversion by the line image sensor arrays A,B and is converted to electrical signals. The focus adjustment condition of the object lens 100, which here refers to the amount and direction of separation of the image from the focused condition (referred to hereafter as "the defocus amount"), is determined by mathematically processing these signals and calculating a relative shift amount of the subject images.
The field mask 200, field lens 300, aperture stops 401,402, re-imaging lens 501,502, and the image sensor arrays A,B are combined into one module 600. The module 600 can be installed into a camera body.
The mathematical processing method by which the defocus amount is calculated will next be described.
The line image sensor arrays A,B each comprise a plurality of photoelectric converting elements. Line image sensor arrays A,B have a plurality of outputs in the form of strings a[1], . . . ,a[n] and b[1], . . . ,b[n], respectively, as shown in FIGS. 8(a) and 8(b). Correlation calculations are carried out while the data in a specified range for the pair of output signal lines is stepwise shifted in amounts corresponding to fixed data. The range, where the maximum shift number is taken to be lmax, becomes -lmax to lmax. Specifically, the correlation amount C[L] is calculated through the following Equation (1). EQU C[L]=.SIGMA..vertline.a[i+L]-b[i].vertline. (1)
where L=-lmax, . . . ,-2,-1,0,1,2, . . . ,lmax and .SIGMA. indicates the summation of i=k.fwdarw.r.
In Equation (1), L is an integer and represents the data line shift amount described above. The initial value k and the final value r change, depending on the shift amount L, as shown in Equation (2).
When L.gtoreq.0: EQU k=k0+INT{-L/2} (2) EQU r=r0+INT{-L/2}
When L&lt;0: EQU k=k0+INT{(-L+1)/2} EQU r=r0+INT{(-L+1)/2},
where k0 and r0 are the initial and final values when the shift amount L=0 and INT means the integer value for the relationship.
The combination of signals for calculating the absolute value of the difference between the signals from line image sensor arrays A,B in Equation (1), when the initial value k and the final value r are changed using Equation (2), and the calculating range, where the absolute value of the difference is added, is shown in FIG. 9. Thus, by changing the shift amount L, the ranges used for the correlation calculations shift in opposite directions to each other.
A focus detection method using initial value k and final value r, regardless of the shift amount L is also known. The range used for the correlation calculation for the string of one array is continually fixed, and only the other string shifts. Since the relative position shift amount becomes the shift amount L when the data coincides, the shift amount Lm that gives the local minimum value correlation amount among the correlation amounts C[L], is determined. This value, coupled with a constant, determined by the optical system of FIG. 6 and the pitch width of the image sensor arrays' photoelectric converting elements, becomes the defocus amount. Thus, as the maximum shift number lmax becomes larger, the defocus amount, at which detection can still be determined, becomes larger.
The correlation amounts C[L] are discrete as shown in FIG. 8(c). The smallest defocus amount that can be detected is limited by the pitch width of the photoelectric converting elements in the line image sensor arrays A,B. To overcome this limitation, Japanese Laid-Open Patent Application Sho 60-37513, corresponding to U.S. Pat. No. 4,561,479, sets forth a method, where a new local minimum value Cex is calculated by interpolating the discrete correlation amounts C[L] and then carrying out a detailed focus detection.
As illustrated in FIG. 7, this method calculates a true local minimum value Cex and a shift amount Ls that gives Cex, using Equations (3) and (4). ##EQU1## where, DL is explained in U.S. Pat. No. 4,561,479, the correlation amount C[l] is the local minimum value and the correlation amounts, C[l+1] and C[l-1], are the shift amounts on either side of the correlation amount C[l], and l is an integer representing the local minimum shift amount. EQU Ls=1+DL/E (4)
In Equation (3), MAX {C(a), C(b)} means that the largest value of C(a) and C(b) is selected. The defocus amount DF is calculated from the shift amount, Ls according to Equation (5). EQU DF=Kf.times.Ls (5)
where, Kf is a constant determined by the optical system of FIG. 6 and pitch width of the image sensor arrays photoelectric converting elements.
It may be necessary to determine whether the obtained defocus amount indicates the true defocus amount, or whether the defocus amount is inaccurate, due to noise or the like. When Equation (6) is satisfied, the defocus amount is considered accurate. EQU E&gt;E1 & Cex/E&lt;G1 (6)
where E1 and G1 are specified threshold values, and E indicates the changed correlation amount and depends on the subject's contrast. The larger the value of E, the higher the contrast and reliability. Cex, defined above, is the difference when the data most closely coincides and is initially 0.
However, due to the influence of noise and a parallax generated by regions 101, 102, Cex=0. Because higher contrast results in a smaller influence from noise and the difference of the subject images, Cex/E indicates the coincidence of the data. Obviously, the closer Cex/E is to 0, the higher the coincidence of the data and the higher the reliability.
The contrast relating to the data may also be calculated, instead of the numerical value E. A reliability evaluation can be carried out using this calculated contrast. When reliability has been determined, the object lens 100 is driven or a display based on the defocus amount DF is determined. Equations (1)-(6), consisting of correlation calculations, interpolation calculations and conditional evaluations, are referred to as focus detection calculations.
Another known focus detection device is disclosed in Japanese Laid-Open Patent Application Sho 60-37513. In this device, the correlation amounts C[L] are not calculated for the entire shift range, -lmax-lmax. Rather, shift amount L is first changed in order, to 0, 1, -1, 2, -2, . . . , lmax, -lmax. The correlation amounts C[L] are next calculated, and the calculated correlation amounts are then interrupted only when a reliable defocus amount satisfying Equation (6) is obtained. Thus, since C[0] is a local minimum when the object lens is near the focused condition, the defocus amount can be quickly calculated by calculating three correlation amounts C[0], C[1], and C[-1]. Therefore, if the subject is moving, the movement of the subject can be followed, and the object lens can be promptly focused on the subject.
However, because of errors in the initial positioning of module 600 in the camera, the signal strings output from line image sensors A,B will not perfectly coincide and errors will be generated, even when the object lens 100 is in a focused condition. Therefore, it is still necessary to correct the error generated between the signal strings (hereafter "error amount") when the object lens is in the focused condition. Thus, the defocus amount DF is calculated by Equation (7), rather than the Equation (5). EQU DF=Kf.times.(Ls-Hz) (7)
where Hz is a correction coefficient for the error amount Z. If Hz is taken to equal Z, when the error amount Z is expressed in units of the photoelectric conversion elements' pitch width, the correction coefficient Hz in Equation (7) becomes Z.
Since the error amount Z differs for each camera body, the error amount Z should be measured after the camera has been assembled. Alternatively, the error amount Z could be measured during assembly. The error amount Z is stored in a memory, such as an EEPROM or the like, within the camera body.
If the error amount Z of the line image sensor arrays A,B is stored in each camera and the calculated result is corrected each time the defocus amount is calculated using error amount Z, it is unnecessary for the signal strings to perfectly coincide, even when the photo lens is in the focused condition. Therefore, the freedom of design of the focus detection optical system increases. It becomes unnecessary to precisely adjust the module when installing it into the camera.
As is seen in FIG. 9, the error amount Z is either positive or negative. When the output representing the line image sensor array A is shifted to a smaller photoelectric conversion number, with respect to the output representing the line image sensor array B, Z becomes negative. When the image shifts in the reverse direction, error amount Z becomes positive.
When the error amount Z of the image sensors is smaller than the pitch width of the photoelectric conversion elements, there is no problem. However, when the error amount Z exceeds the pitch width of the photoelectric conversion elements, since the shift amount for a local minimum value in focusing moves in an amount equal to the error amount Z, the following problems occur:
(1) Since the focal point shifts from the center of shift range of -lmax to lmax, the defocus amount differs between the front focus and the rear focus in amount equal to the shift.
(2) In focus detection devices, which change the shift amount L to 0, 1, -1, 2, -2, . . . , calculate the correlation amounts C[L] and interrupt the correlation calculations when a reliable defocus amount satisfying Equation (6) is not found, extra calculation time is required. This increase of time correspondingly increases the correlation amount C[0] in an amount equal to the local minimum value.
For example, if the error amount Z is 2 photoelectric conversion element widths, the correlation amount C[L] equals its local minimum value when the shift amount L equals 2 during focusing. In Equation (4), when C[0] equals its local minimum value during focusing and the true local minimum value is to be calculated using three correlation amounts, C[0], C[1] and C[-1], the true local minimum value cannot be determined when the correlation amount C[L=2] becomes the local minimum value during focusing. The only way for the true local minimum value to be determined is to calculate the six correlation amounts C[0], C[1], C[-1], C[2], C[-2]and C[3].